package models

import (
	"gitee.com/cjf8134/bbs_serve/internal/pkg/utils/constutil"
)

type Thread struct {
	Model
	Title      string  `form:"title" json:"title"`
	Content    string  `form:"content" json:"content"`
	Tag        string  `form:"tag" json:"tag"`
	Username   string  `form:"username" json:"username"`
	Avatar     string  `form:"avatar" json:"avatar"`
	Digest     int     `form:"is_digest" json:"is_digest"`
	Top        int     `form:"top" json:"top"`
	Hot        int     `form:"hot" json:"hot"`
	ViewNum    int     `form:"view_num" json:"view_num"`
	CommentNum int     `form:"comment_num" json:"comment_num"`
	Comment    Comment `form:"comment" json:"comment" gorm:"foreignKey:thread_id;association_foreignkey:id"`
}

func (Thread) TableName() string {
	return constutil.TablePrefix + "thread"
}
